package com.ncell.cell;

public class SimpleP implements P {

    private float x;
    private float y;
    private float activation;
    //level of currentMaxOarknOfConnectedI that calculated to determine what I currently owns this P
    private float currentMaxOarknOfConnectedI;
    private float activationOffset;

    /**
     * does this P connected to active I or TP in current iteration
     */
    private boolean connectedToActive;

    @Override
    public float getActivationOffset() {
        return activationOffset;
    }

    @Override
    public void setActivationOffset(float activationOffset) {
        this.activationOffset = activationOffset;
    }

    @Override
    public boolean isConnectedToActive() {
        return connectedToActive;
    }

    @Override
    public void setConnectedToActive(boolean connectedToActive) {
        this.connectedToActive = connectedToActive;
    }

    @Override
    public float getActivation() {
        return activation;
    }

    @Override
    public void setActivation(float activation) {
        this.activation = activation;
    }

    @Override
    public boolean isPActive() {
        return activation > 0.5;
    }

    @Override
    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    @Override
    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    @Override
    public float getCurrentMaxOarknOfConnectedI() {
        return currentMaxOarknOfConnectedI;
    }

    @Override
    public void setCurrentMaxOarknOfConnectedI(float currentMaxOarknOfConnectedI) {
        this.currentMaxOarknOfConnectedI = currentMaxOarknOfConnectedI;
    }

    @Override
    public String toString() {
        return "P. a=" + activation + ";connected=" + isConnectedToActive() + ";oarkn=" + currentMaxOarknOfConnectedI+";offset="+activationOffset;
    }

}
